<template>
<div>

  <h1>修改</h1>
  <p><input type="text" v-model="name">姓名</p>
  <button @click="put(name)">修改</button>


</div>
</template>

<script>
export default {
  name: "put_1",
  data(){
    return{
      id : this.$route.query.id,
      name:""
    }
  },
  methods:{
    put(name){
      this.$axios.put('http://127.0.0.1:5000/add?id='+this.id+'&name='+name)
        .then(i=>{
          if (i.data.code ==200){
            alert("修改成功")
            this.$router.push('cate/')
          }
        })
    }

  },
  mounted() {
  }
}
</script>

<style scoped>

</style>
